# Contributor: kpcyrd <git@rxv.cc>
# Maintainer: kpcyrd <git@rxv.cc>
pkgname=dfrs
pkgver=0.0.7
pkgrel=0
pkgdesc="Display file system space usage using graphs and colors"
url="https://github.com/anthraxx/dfrs"
# s390x and riscv64 blocked by rust/cargo
arch="all !s390x !riscv64"
license="MIT"
makedepends="
	cargo
	scdoc
	"
subpackages="$pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-fish-completion
	"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/anthraxx/dfrs/archive/$pkgver.tar.gz"

build() {
	make
}

check() {
	make test
}

package() {
	install -Dm 755 "$builddir/target/release/dfrs" -t "$pkgdir/usr/bin"
	install -Dm 644 "$builddir/contrib/man/dfrs.1" -t "$pkgdir/usr/share/man/man1"

	install -Dm 644 "$builddir/target/completion/bash/dfrs" -t "$pkgdir/usr/share/bash-completion/completions"
	install -Dm 644 "$builddir/target/completion/zsh/_dfrs" -t  "$pkgdir/usr/share/zsh/site-functions"
	install -Dm 644 "$builddir/target/completion/fish/dfrs.fish" -t  "$pkgdir/usr/share/fish/completions"
}

sha512sums="8b8f67ff919e4f1012fe415b564574fe9b11caf01da90a025ca8b8c7707e3f90e865e30cfbeb24db7b80829d082ba7accce44e1897a67e39d129d94c171f21fe  dfrs-0.0.7.tar.gz"
